
import fs from 'fs'
const myReadFile = url =>{
  const p = new Promise((resolve, reject) =>{
    fs.readFile(url, 'utf-8', (err, dataStr) =>{
      !err ? resolve(dataStr) : reject(err)
    })
  })
  return p
}
myReadFile('./text/1.txt').then(res=>{
  console.log(res)
  return myReadFile('./text/2.txt')})
  .then(res=>{console.log(res)})
  .catch(err=>{console.log(err)})